package core.ui.demo;

import javafx.collections.ObservableList;
import javafx.scene.Node;
import javafx.scene.control.Toggle;
import javafx.scene.control.ToggleButton;
import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.VBox;
/**
 * @author 李瑜
 * @since JavaFX 8.0
 */
public class DemoToggleButton
{
	public static VBox getToggleButton()
	{
		VBox box = new VBox();
		box.setSpacing(5);
		ObservableList<Node> boxs = box.getChildren();
		
		ToggleGroup group = new ToggleGroup();
		ObservableList<Toggle> lists = group.getToggles();
		ToggleButton toggleButton1 = new ToggleButton("开关按钮1");
		ToggleButton toggleButton2 = new ToggleButton("开关按钮2");
		ToggleButton toggleButton3 = new ToggleButton("开关按钮3");
		ToggleButton toggleButton4 = new ToggleButton("开关按钮4");
		
		lists.add(toggleButton1);
		lists.add(toggleButton2);
		lists.add(toggleButton3);
		lists.add(toggleButton4);
		
		boxs.add(toggleButton1);
		boxs.add(toggleButton2);
		boxs.add(toggleButton3);
		boxs.add(toggleButton4);
		
		return box;		
	}
}
